<?php
// No direct access
defined('_JEXEC') or die;
jimport('joomla.application.component.view');
class VolunteerViewAddfile extends JView {
	function display($tpl = null) {
		$model = $this->getModel('volunteer'); //get default model (volunteer)
		
		$this->assignRef('locations', $model->getLocations());
		$this->assignRef('timespans', $model->getTimespans());
		$this->assignRef('industries', $model->getIndustries());
		$this->assignRef('keywordList', $model->getKeywords());
		
		$app  = JFactory::getApplication();
		$data = $app->getUserState('volunteer.addfile.form.data');
		
		$file              = new stdClass;
		$file->name        = $data['name'];
		$file->description = $data['description'];
		$file->location_id = $data['location'];
		$file->timespan_id = $data['timespan'];
		$file->industry_id = $data['industry'];
		$this->assign('keywords', $data['keywords']);
		$file->acknowledgement = $data['acknowledgement'];
		$this->assign('file', $file);
		
		parent::display($tpl); //display defaul template
	}
}